import {} from 'react'
import style from './index.module.less'
import { Button } from 'antd-mobile'
import logo from '@imgs/logo.png'
import { appName } from '@src/assets/js/config'
import News from './components/news'
import Gonggao from './components/gonggao'
import { useAppDispatch } from '@src/redux/hook'
import { push } from '@src/redux/reducers/pages'
import uuid from 'uuid'

function Main () {
  const dispatch = useAppDispatch()
  return (
    <div className={style.container}>
      <div className={style.header}>
        <div className={style.title}>
          <img src={logo} className={style.logo} />
          <span>{appName}</span>
        </div>
        <Button size='large' className={style.first} color='primary' block onClick={() => {
          dispatch(push({ element: 'institutions', title: '选择仲裁委', id: uuid(), meta: { p: 'register' } }))
        }}>去立案</Button>
        <Button size='large' block onClick={() => {
          dispatch(push({ element: 'institutions', title: '选择仲裁委', id: uuid(), meta: { p: 'cases' } }))
        }}>我的案件</Button>
      </div>
      <News />
      <Gonggao />
    </div>
  )
}

export default Main
